package com.zhang.learn.internationalization;

import java.util.Locale;
import java.util.ResourceBundle;

public class InternationalTest {
    public static void main(String[] args) {
        Locale locale = Locale.getDefault();
        ResourceBundle rb = ResourceBundle.getBundle("message",locale);
        String book = rb.getString("book");
        System.out.println("book = " + book);


        //native2ascii
        //java -jar native2ascii.jar -encoding UTF-8 -reverse message.properties message.properties
        










        int[] arr = {8,5,3,90,23,89};
        quickSort(arr,0,5);
        //数组打印
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }

    }

    //帮我写一个千万级数据量的数据的快速排序算法

    public static void quickSort(int[] arr,int low,int high){

        if(low < high){
            int pivotloc = partition(arr,low,high);
            quickSort(arr,low,pivotloc-1);
            quickSort(arr,pivotloc+1,high);
        }
    }

    public static int partition(int[] arr,int low,int high){

        int pivot = arr[low];
        while(low < high){
            while(low < high && arr[high] >= pivot){
                high--;
            }
            arr[low] = arr[high];
            while(low < high && arr[low] <= pivot){
                low++;
            }
            arr[high] = arr[low];
        }
        arr[low] = pivot;
        return low;
    }
}
